<div class="container">
    <div ng-controller="generatorInstanceManageController">
        <div class="row">
            <div class="col-sm-12">
                <form class="form-inline">
                    <div class="form-group">
                        <input name="name" type="text" class="form-control input-sm" ng-model="searchRequest.name" placeholder="名称"/>
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-info btn-sm" ng-click="search({'page':1});">搜索</button>
                    </div>
                </form>
                <br/>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table class="table table-condensed table-hover">
                    <thead>
                    <tr class="active">
                        <th width="30">#</th>
                        <th width="150">ID</th>
                        <th width="200">名称</th>
                        <th width="200">生成器</th>
                        <th width="150">创建日期</th>
                        <th width="150">修改日期<span class="glyphicon glyphicon-sort-by-attributes-alt text-info" aria-hidden="true"></span></th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="generatorInstance in pagerResult.records track by $index">
                        <th>{{$index + 1}}</th>
                        <td>{{generatorInstance.id}}</td>
                        <td>{{generatorInstance.name}}</td>
                        <td>{{generatorInstance.generator.name}}</td>
                        <td>{{generatorInstance.createDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                        <td>{{generatorInstance.modifyDate | date : "yyyy-MM-dd HH:mm:ss"}}</td>
                        <td>
                            <button type="button" class="btn btn-sm" ng-class="{'btn-success':generatorInstance.generator.isOpen,'btn-danger':!generatorInstance.generator.isOpen}" location-go="/business/dataModel/manage/{{generatorInstance.id}}">工作台</button>
                            <div class="btn-group">
                                <button type="button" class="btn btn-info btn-sm" location-go="/business/generatorInstance/detail/{{generatorInstance.id}}">详情</button>
                                <button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>
                                <ul class="dropdown-menu">
                                    <li><a href="javascript:void(0);" location-go="/business/generatorInstance/update/{{generatorInstance.id}}">修改</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="javascript:void(0);" ng-click="delete(generatorInstance)">删除</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div>
            <div class="pull-left">
                <ul class="pagination pagination-sm">
                    <li ng-class="{'active': searchRequest.pageSize==pageSize}" ng-repeat="pageSize in [10, 20, 50]" ><a href="javascript:void(0);" ng-click="(searchRequest.pageSize!=pageSize)&&search({'pageSize':pageSize,'page':1});">{{pageSize}}</a></li>
                </ul>
            </div>
            <div class="pull-left">
                &nbsp;
                <uib-pagination class="pagination-sm" boundary-links="true" rotate="false" max-size="10" total-items="pagerResult.total" ng-model="searchRequest.page" ng-change="search();" items-per-page="searchRequest.pageSize" first-text="首页" previous-text="上页" next-text="下页" last-text="尾页"></uib-pagination>
            </div>
            <div class="pull-left form-control-static clearfix">&nbsp;共&nbsp;{{pagerResult.total ? pagerResult.total : 0}}&nbsp;条</div>
        </div>
    </div>
</div>